#ifndef __BUOLA_SCENE_CGEODE_H__
#define __BUOLA_SCENE_CGEODE_H__

#include <buola/scene.h>
#include <buola/scene/cobject.h>
#include <buola/algorithm/container.h>
#include <buola/image/ccolor.h>
#include <BulletCollision/CollisionShapes/btCollisionShape.h>

namespace buola { namespace scene {

typedef std::unique_ptr<btCollisionShape> PBulletCollisionShape;
    
class CGeode : public CObject
{
public:
    CGeode();
    CGeode(PMesh pMesh);
    ~CGeode();

public:
    static PGeode Import(const io::CURI &pURI,double pScale=1.0);

    void SetMaterial(const PMaterial &pMaterial);
    void SetColor(const img::CColor &pColor)    {   mColor=pColor;  }
    const img::CColor &Color()                  {   return mColor;  }
    
    virtual void Render(CRenderContext &pContext);
    virtual void CollectPolygons(std::vector<mat::CVec3d> &pPoints,std::vector<mat::CVec3d> &pNormals,std::vector<int> &pFaces);
    virtual PBulletCollisionShape GetCollisionShape()     {   return nullptr; }
    
private:
    PMesh mMesh;
    
    PMaterial mMaterial;
    CTechnique *mTechnique;
    CTechnique *mTITechnique;
    img::CColor mColor;
};

/*namespace scene*/ } /*namespace buola*/ }

#endif
